package com.aw.baselib.base;

import android.os.Bundle;

import androidx.annotation.Nullable;


/**
 * Created by hzw
 */

public abstract class AwMvpLazyFragment<T extends AwCommonPresenter> extends AwBaseLazyFragment {
    protected T mPresenter;

    protected abstract T createPresenter();

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mPresenter = createPresenter();
        if (null != mPresenter) {
            mPresenter.attachView();
        }
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        if (null != mPresenter) {
            mPresenter.detachView();
        }
    }
}
